package com.itheima.easy.mapper;

import com.itheima.easy.entity.DeptPostUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptPostUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(DeptPostUser record);

    int insertSelective(DeptPostUser record);

    DeptPostUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DeptPostUser record);

    int updateByPrimaryKey(DeptPostUser record);

    int batchInsert(@Param("list") List<DeptPostUser> list);

    List<DeptPostUser> findDeptPostUserListInUserId(@Param("userIds") List<Long> userIdSet);

    int deleteDeptPostUserByUserId(@Param("userId") Long userId);

    int deleteDeptPostUserInUserId(@Param("userIds") List<Long> userIds);

    List<DeptPostUser> findDeptPostUserByUserId(@Param("userId")Long userId);

    @Select("select user_id from tab_dept_post_user where dept_no = #{deptNo}")
    List<Long> selectByDeptNo(String deptNo);
}
